#include<iostream>
using namespace std;
#include<unistd.h>
#include<pthread.h>
void *newthread(void *s)
{
    while(1)
    {
        cout << "this is new thread,tid:" <<pthread_self()<< endl;
        sleep(2);
    }
}
int main()
{
    pthread_t id;
    pthread_create(&id, nullptr, newthread, (void *)"syx 666");
    while(1)
    {
        sleep(1);
        cout << "this is main thread,tid:" <<pthread_self()<< endl;
    }
    return 0;
}